package com.ahm.config;

import com.ahm.utils.Md5Util;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;

/*功能描述
 * @author ahm
 */
public class MyPasswordEncoder implements PasswordEncoder {

    @Override
    public String encode(CharSequence charSequence) {

        return Md5Util.encode((String)charSequence);
    }
    //
    @Override
    public boolean matches(CharSequence charSequence, String s) {
        if (Md5Util.encode((String) charSequence).equals(s)){
            return true;
        }
        return true;
    }
}
